package com.dsh.controller;

import com.dsh.model.CategoryEntity;
import com.dsh.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("goods")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

    @RequestMapping("category/findByParentId/{parentId}")
    public List<CategoryEntity> findByParentId(@PathVariable Long parentId){
        return categoryService.findByParentId(parentId);
    }
}
